/******************************************************************************
 * Copyright (C) 2016  671643387@qq.com
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 *****************************************************************************/

#ifndef NODE_UTIL_OPTION_SET_H_
#define NODE_UTIL_OPTION_SET_H_

#include <string>
#include <vector>
#include <node/noncopyable.h>
#include <node/util/option.h>

namespace node {
    namespace util {

    class option_set : private noncopyable
    {
    public:
        typedef std::vector<option>::iterator iterator;
        typedef std::vector<option>::const_iterator const_iterator;

        option_set(void);
        ~option_set(void);

        iterator begin(void);
        iterator end(void);
        const_iterator begin(void) const;
        const_iterator end(void) const;

        void add_option(const node::util::option& option);
        void process(std::vector<std::string>& arguments);

    private:
        std::vector<option> _options;
    };
    inline option_set::iterator option_set::begin(void) { return _options.begin(); }
    inline option_set::iterator option_set::end(void) { return _options.end(); }
    inline option_set::const_iterator option_set::begin(void) const { return _options.begin(); }
    inline option_set::const_iterator option_set::end(void) const { return _options.end(); }
}}

#endif //NODE_UTIL_OPTION_SET_H_
